<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html lang="zh-CN" style="overflow-x: hidden;">
<head>
<%@include file="/template/basic.jspf"%>
</head>
<body>
	<div class="wrap">
		<div class="row-fluid panel panel-default">
			<div class="panel-body">
				<div class="row-fluid">
					<form action="" id="form" class="form-horizontal">
						<input type="hidden" value="${functionId }" name="function_id" />
						<div id="sysRole" class="form-group">
							<div class="col-xs-2">
								<input type="checkbox" id="checkSys" /> 系统角色
							</div>
							<div class="col-xs-2">
								<c:set var="flag" value="0" />
								<c:forEach var="hasRole" items="${listRoleId }">
										<c:if test='${"everyone" eq hasRole.role_id }'>
											<c:set var="flag" value="1" />
										</c:if>
								  </c:forEach> 
								  <c:if test="${flag eq 1  }">
									<input type="checkbox" name="role_id" value="everyone" checked="checked" /> 所有人角色
									</c:if>
									<c:if test="${flag eq 0  }">
										<input type="checkbox" name="role_id" value="everyone" /> 所有人角色
									</c:if>
							</div>
							<div class="col-xs-2">
								<input type="checkbox" name="role_id" value="administrator"
									checked="checked" disabled="disabled" /> 系统管理员
							</div>
							
						</div>
						<div class="form-group">
							<div class="col-xs-2">
								<input type="checkbox" id="checkCustom" /> 自定义角色
							</div>
							<div id="xlxka" class="col-xs-10">
								<c:forEach var="one" items="${list}" varStatus="cou">
									<c:if
										test='${one.role_id!="administrator" && one.role_id!="everyone" }'>
										<div class="col-xs-3">
											<c:set var="flag" value="0" />
											<c:forEach var="hasRole" items="${listRoleId }">
												<c:if test="${one.role_id eq hasRole.role_id }">
													<c:set var="flag" value="1" />
												</c:if>
											</c:forEach>
											<c:if test="${flag eq 1  }">
												<input type="checkbox" value="${one.role_id }"
													name="role_id" checked="checked" /> ${one.role_name}
														
														</c:if>
											<c:if test="${flag eq 0  }">
												<input type="checkbox" value="${one.role_id }"
													name="role_id" /> ${one.role_name}
												</c:if>
										</div>
									</c:if>
								</c:forEach>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/js/system/function/roleResList.js"></script>
</body>
</html>